import { useEffect } from "react";
import { NavBar, Icon, List } from "antd-mobile";
import { DashOutlined, LeftOutlined } from "@ant-design/icons";
import { useHistory } from "react-router-dom";
import store from "../../../store";
const Item = List.Item;
function SettingUp() {
  let history = useHistory();
  useEffect(() => {
    store.dispatch({
      type: "footer_hidden",
      hidden: true,
    });
  }, []);
  return (
    <div>
      <div>
        <NavBar
          mode="light"
          icon={<LeftOutlined />}
          onLeftClick={() => {
            if (localStorage.getItem("token")) {
              window.history.back(-1);
            } else {
              history.push("/home");
            }

            store.dispatch({
              type: "footer_hidden",
              hidden: false,
            });
          }}
        ></NavBar>
        <div
          style={{
            position: "absolute",
            right: "20px",
            top: "15px ",
            width: "20px",
            height: "20px",
          }}
        >
          <DashOutlined />
        </div>
      </div>
      {/* 个人信息 */}
      <div
        style={{
          border: "1px,solid ",
          width: "92%",
          marginLeft: "4%",
          marginTop: "20px",
        }}
      >
        <div>
          <Item extra="收获地址管理" arrow="horizontal" onClick={() => {}}>
            个人信息
          </Item>
          <Item arrow="horizontal" onClick={() => {}}>
            账户安全
          </Item>
          <Item arrow="horizontal" onClick={() => {}}>
            消息提醒设置
          </Item>
          <Item arrow="horizontal" onClick={() => {}}>
            通用
          </Item>
        </div>
        <div style={{ marginTop: "20px" }}>
          <Item arrow="horizontal" onClick={() => {}}>
            图片质量
          </Item>
        </div>
        <div style={{ marginTop: "10px" }}>
          <Item arrow="horizontal" onClick={() => {}}>
            新浪微博
          </Item>
        </div>
        <div style={{ marginTop: "30px" }}>
          <Item arrow="horizontal" onClick={() => {}}>
            关于我们
          </Item>
          <Item arrow="horizontal" onClick={() => {}}>
            意见反馈
          </Item>
          <Item arrow="horizontal" onClick={() => {}}>
            给天猫评分
          </Item>
        </div>
      </div>

      {/* 退出登录 */}
      <div
        style={{
          marginTop: "30px",
          color: "#fff",
          textAlign: "center",
          width: "100%",
          height: "60px",
          backgroundColor: "red",
          lineHeight: "60px",
          borderRadius: "40px",
        }}
        onClick={() => {
          localStorage.removeItem("token");
          localStorage.removeItem("uid");
          history.push("/login");
        }}
      >
        退出登录
      </div>
    </div>
  );
}
export default SettingUp;
